/********************************************************************
FileName    :   Bll_yw_rkdH.cs
CreateTime  :   2015-09-18 12:09
BaseClass   :   Bll_yw_rkdH
FileType    :   .cs
Author      :  minjie
Description :   Bll_yw_rkdHBLL层（简单三层）
*********************************************************************/

using System;
using System.Text;
using System.Collections.Generic;

using System.Data;
using OS.Common;
using OS.DAL;
namespace OS.BLL
{
	/// <summary>
	/// Bll_yw_rkdH的摘要说明。
	/// </summary>
public partial class   Bll_yw_rkdH 
  	{ 
     		      
  		private readonly Dal_yw_rkdH dal=new  Dal_yw_rkdH(); 
  		public  Bll_yw_rkdH() 
  		{} 
  		 
  		#region  Method 
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public bool  Add(yw_rkdH_Entity model) 
  		{ 
  			return dal.Add(model); 
  		} 
   
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public  string  AddStr(yw_rkdH_Entity model) 
  		{ 
  			return dal.AddStr(model); 
  		} 
   
  		/// <summary> 
  		/// 更新一条数据 
  		/// </summary> 
  		public bool Update(yw_rkdH_Entity model) 
  		{ 
  			return dal.Update(model); 
  		} 
   
  		/// <summary> 
  		/// 删除一条数据 
  		/// </summary> 
  		public bool Delete(int  DjLsh) 
  		{ 
  			 
  			return dal.Delete(DjLsh); 
  		} 
  		/// <summary> 
  		/// 批量删除一批数据 
  		/// </summary> 
  		public bool DeleteList(string DjLshlist ) 
  		{ 
  			return dal.DeleteList(DjLshlist ); 
  		} 
  		/// <summary> 
  		/// 得到一个对象实体 
  		/// </summary> 
  		public yw_rkdH_Entity GetModel(int  DjLsh) 
  		{ 
  			 
  			return dal.GetModel(DjLsh); 
  		} 
   
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetList(string strWhere) 
  		{ 
  			return dal.GetList(strWhere); 
  		} 
  		/// <summary> 
  		/// 获得前几行数据 
  		/// </summary> 
  		public DataSet GetList(int Top,string strWhere,string filedOrder) 
  		{ 
  			return dal.GetList(Top,strWhere,filedOrder); 
  		} 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public List<yw_rkdH_Entity> GetModelList(string strWhere) 
  		{ 
  			DataSet ds = dal.GetList(strWhere); 
  			return DataTableToList(ds.Tables[0]); 
  		} 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public List<yw_rkdH_Entity> GetModelList(string strWhere, string orderby, int startIndex, int endIndex) 
  		{ 
  			DataSet ds = dal.GetListByPage(strWhere, orderby, startIndex, endIndex); 
  			return DataTableToList(ds.Tables[0]); 
  		} 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public List<yw_rkdH_Entity> DataTableToList(DataTable dt) 
  		{ 
  			List<yw_rkdH_Entity> modelList = new List<yw_rkdH_Entity>(); 
  		  if (dt!=null ) 
  		  { 
  			int rowsCount = dt.Rows.Count; 
  			if (rowsCount > 0) 
  			{ 
  				yw_rkdH_Entity   model; 
  				for (int n = 0; n < rowsCount; n++) 
  				{ 
  					model = new yw_rkdH_Entity();					 
  				if(dt.Rows[n]["DjLsh"]!=null&&dt.Rows[n]["DjLsh"].ToString()!="") 
  				{ 
  					model.DjLsh=int.Parse(dt.Rows[n]["DjLsh"].ToString()); 
  				} 
  				if(dt.Rows[n]["DjBtZdh"]!=null&&dt.Rows[n]["DjBtZdh"].ToString()!="") 
  				{ 
  					model.DjBtZdh=int.Parse(dt.Rows[n]["DjBtZdh"].ToString()); 
  				} 
  				if(dt.Rows[n]["DjFtZdh"]!=null&&dt.Rows[n]["DjFtZdh"].ToString()!="") 
  				{ 
  					model.DjFtZdh=int.Parse(dt.Rows[n]["DjFtZdh"].ToString()); 
  				} 
  				if(dt.Rows[n]["DjStZdh"]!=null&&dt.Rows[n]["DjStZdh"].ToString()!="") 
  				{ 
  					model.DjStZdh=int.Parse(dt.Rows[n]["DjStZdh"].ToString()); 
  				} 
  				model.DjState= dt.Rows[n]["DjState"].ToString(); 
  				if(dt.Rows[n]["DjCount"]!=null&&dt.Rows[n]["DjCount"].ToString()!="") 
  				{ 
  					model.DjCount=int.Parse(dt.Rows[n]["DjCount"].ToString()); 
  				} 
  				if(dt.Rows[n]["rkrq"]!=null&&dt.Rows[n]["rkrq"].ToString()!="") 
  				{ 
  					model.rkrq=DateTime.Parse(dt.Rows[n]["rkrq"].ToString()); 
  				} 
  				model.djzt= dt.Rows[n]["djzt"].ToString(); 
  				model.rkdh= dt.Rows[n]["rkdh"].ToString(); 
  				model.rkbmh= dt.Rows[n]["rkbmh"].ToString(); 
  				model.rkbm= dt.Rows[n]["rkbm"].ToString(); 
  				model.ckbh= dt.Rows[n]["ckbh"].ToString(); 
  				model.ckmc= dt.Rows[n]["ckmc"].ToString(); 
  				model.gysbh= dt.Rows[n]["gysbh"].ToString(); 
  				model.gysmc= dt.Rows[n]["gysmc"].ToString(); 
  				model.rklx= dt.Rows[n]["rklx"].ToString(); 
  				model.bz= dt.Rows[n]["bz"].ToString(); 
  				if(dt.Rows[n]["slhj"]!=null&&dt.Rows[n]["slhj"].ToString()!="") 
  				{ 
  					model.slhj=decimal.Parse(dt.Rows[n]["slhj"].ToString()); 
  				} 
  				if(dt.Rows[n]["jehj"]!=null&&dt.Rows[n]["jehj"].ToString()!="") 
  				{ 
  					model.jehj=decimal.Parse(dt.Rows[n]["jehj"].ToString()); 
  				} 
  				if(dt.Rows[n]["xj"]!=null&&dt.Rows[n]["xj"].ToString()!="") 
  				{ 
  					model.xj=decimal.Parse(dt.Rows[n]["xj"].ToString()); 
  				} 
  				if(dt.Rows[n]["qk"]!=null&&dt.Rows[n]["qk"].ToString()!="") 
  				{ 
  					model.qk=decimal.Parse(dt.Rows[n]["qk"].ToString()); 
  				} 
  				if(dt.Rows[n]["zr"]!=null&&dt.Rows[n]["zr"].ToString()!="") 
  				{ 
  					model.zr=decimal.Parse(dt.Rows[n]["zr"].ToString()); 
  				} 
  				if(dt.Rows[n]["yfk"]!=null&&dt.Rows[n]["yfk"].ToString()!="") 
  				{ 
  					model.yfk=decimal.Parse(dt.Rows[n]["yfk"].ToString()); 
  				} 
  				if(dt.Rows[n]["wfk"]!=null&&dt.Rows[n]["wfk"].ToString()!="") 
  				{ 
  					model.wfk=decimal.Parse(dt.Rows[n]["wfk"].ToString()); 
  				} 
  				model.cgdh= dt.Rows[n]["cgdh"].ToString(); 
  				model.zdr= dt.Rows[n]["zdr"].ToString(); 
  				if(dt.Rows[n]["zdsj"]!=null&&dt.Rows[n]["zdsj"].ToString()!="") 
  				{ 
  					model.zdsj=DateTime.Parse(dt.Rows[n]["zdsj"].ToString()); 
  				} 
  				model.shr= dt.Rows[n]["shr"].ToString(); 
  				if(dt.Rows[n]["shsj"]!=null&&dt.Rows[n]["shsj"].ToString()!="") 
  				{ 
  					model.shsj=DateTime.Parse(dt.Rows[n]["shsj"].ToString()); 
  				} 
  				if(dt.Rows[n]["gyszk"]!=null&&dt.Rows[n]["gyszk"].ToString()!="") 
  				{ 
  					model.gyszk=decimal.Parse(dt.Rows[n]["gyszk"].ToString()); 
  				} 
  				model.ddh= dt.Rows[n]["ddh"].ToString(); 
  				if(dt.Rows[n]["lsjehj"]!=null&&dt.Rows[n]["lsjehj"].ToString()!="") 
  				{ 
  					model.lsjehj=decimal.Parse(dt.Rows[n]["lsjehj"].ToString()); 
  				} 
  				model.khmc= dt.Rows[n]["khmc"].ToString(); 
  				 
  					modelList.Add(model); 
  				} 
  			} 
  		} 
  			return modelList; 
  		} 
   
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetAllList() 
  		{ 
  			return GetList(""); 
  		} 
   
  		/// <summary> 
  		/// 获取记录总数 
  		/// </summary> 
  		public int GetRecordCount(string strWhere) 
  		{ 
  			return  dal.GetRecordCount(strWhere); 
  		} 
  #endregion 
      
  	} 
  
}
